#ifndef __MPUIIC_H
#define __MPUIIC_H
#include <stdint.h>

#define MPU_SDA_PIN PB10
#define MPU_SCL_PIN PB11

#define MPU_SDA_IN()   IOInit(MPU_SDA_PIN, Mode_IN_FLOATING)
#define MPU_SDA_OUT()  IOInit(MPU_SDA_PIN, Mode_Out_PP)

#define MPU_IIC_SCL_H     IOWrite(MPU_SCL_PIN, 1)
#define MPU_IIC_SCL_L     IOWrite(MPU_SCL_PIN, 0)
#define MPU_IIC_SDA_H     IOWrite(MPU_SDA_PIN, 1)
#define MPU_IIC_SDA_L     IOWrite(MPU_SDA_PIN, 0)

#define MPU_READ_SDA   	IORead(MPU_SDA_PIN)


void MPU_IIC_Delay(void);
void MPU_IIC_Init(void);
void MPU_IIC_Start(void);
void MPU_IIC_Stop(void);
void MPU_IIC_Send_Byte(uint8_t txd);
uint8_t MPU_IIC_Read_Byte(unsigned char ack);
uint8_t MPU_IIC_Wait_Ack(void);
void MPU_IIC_Ack(void);
void MPU_IIC_NAck(void);

void IMPU_IC_Write_One_Byte(uint8_t daddr,uint8_t addr,uint8_t data);
uint8_t MPU_IIC_Read_One_Byte(uint8_t daddr,uint8_t addr);	  
#endif
















